<%@ page import="com.the8thfold.anton.users.User; com.the8thfold.anton.ant.AntScriptUser; org.codehaus.groovy.grails.plugins.springsecurity.SpringSecurityUtils; com.the8thfold.anton.users.Roles; com.the8thfold.anton.ant.JobStatus" contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title>Configuration</title>
    <meta name="layout" content="main" />
</head>
<body>

<div>
    <h1>Configuration</h1>
    <hr/>
    <g:each in="${configs.sort{it.id}}" status="configIndex" var="config">
        <h2>${config.name}</h2>
        <table>
            <tr>
                <th>Item</th>
                <th>Value</th>
            </tr>
            <g:each in="${config.configurationItems.sort{it.key}}" status="itemsIndex" var="item">
                <tr class="${itemsIndex%2 ? 'odd' : 'even'}">
                    <td>${item.key}</td>
                    <td style="width: 80%;">
                        <g:formRemote after="jQuery('#${item.id}').effect('highlight',{color: '#90ee90'},1000);" name="f${item.id}" url="[controller: 'settings', action: 'updateProperty', id: item.id]">
                            <g:hiddenField name="itemId" value="${item.id}"/>
                            <input id="${item.id}" class="ui-corner-all" type="text" name="value" value="${item.value}"/>
                            <a title="Save value" href="javascript: void();" onclick="jQuery('#f${item.id}').submit();" name="submit" value="" href="#" class="btn save" icon="ui-icon-disk"></a>
                        </g:formRemote>
                    </td>
                </tr>
            </g:each>
        </table>
    </g:each>
</div>

<br/><br/><br/>
</body>
</html>